#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
void strcpy(char* dest, char* src, int m)
{
	assert(dest != NULL);
	assert(src != NULL);
	char* tmp = src + m - 1;
	while (*dest++ = *tmp++);
}

int main()
{
	char t[1000] = { 0 };
	char s[1000] = { 0 };
	int i = 0, m = 0;
	printf("input string t: ");
	while ((t[i] = getchar()) != '\n')
		i++;
	printf("input m: ");
	scanf("%d", &m);
	strcpy(s, t, m);
	printf("output s: %s", s);
	return 0;
}